import sys
import os
import django

# 添加后端路径
sys.path.append('../backend')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'massage_app.settings')

# 初始化Django
django.setup()

from services.models import Banner

def check_banner_data():
    """检查banner表中的数据"""
    print("=== Banner表数据检查 ===")
    print(f"Banner总数: {Banner.objects.count()}")
    
    banners = Banner.objects.all()
    for banner in banners:
        print(f"\nID: {banner.id}")
        print(f"标题: {banner.title}")
        print(f"描述: {banner.description}")
        print(f"图片URL: {banner.image}")
        print(f"链接: {banner.link}")
        print(f"是否启用: {banner.is_active}")
        print(f"排序: {banner.sort_order}")
        print(f"创建时间: {banner.created_at}")
        print(f"更新时间: {banner.updated_at}")

if __name__ == "__main__":
    check_banner_data()